package com.ct.gd.passport.view;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

public class ShareActivity extends Activity {

    @Override
    protected void onResume() {
        send(getIntent().getStringExtra("content"), this);
        super.onResume();
    }

    public void send(String text, Context context) {
        Intent it = new Intent(Intent.ACTION_SEND);
        it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        it.putExtra(Intent.EXTRA_TEXT, text);
        it.setType("text/plain");
        Intent newIntent = Intent.createChooser(it, "请选择");
        newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(newIntent);
        finish();
    }

}
